package com.kt.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName("overall_metrics")
public class OverallMetrics {
    @TableId(type = IdType.AUTO)
    private Long id;
    private BigDecimal totalSales;
    private BigDecimal discountAmount;
    private BigDecimal originalTotalPrice;
    private Integer totalStock;
    private Integer totalSold;
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    // 扩展字段（用于计算结果）
    @TableField(exist = false)
    private String discountRate;  // 折扣率
    @TableField(exist = false)
    private String selloutRate;   // 售空率
}